package net.xju3_4.entity;

import lombok.*;
import net.xju3_4.common.utils.DateUtils;

import java.time.format.DateTimeFormatter;
import java.util.Date;


@NoArgsConstructor @AllArgsConstructor

@Setter @Getter @ToString
public class OrderEntity {

    private static final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");

    private Integer id;
    private Integer userId;  // 修改为 Integer 类型，与数据库字段类型一致
    private String carId;
    private String merchantId;
    private Date startTime;
    private Date endTime ;
    private Date actualStartTime;
    private Date actualEndTime;
    private String rentDays;
    private String dailyRent;
    private String estimatedTotalAmount;
    private String overtimeFee;
    private String damageFee;
    private String finalAmount;
    private Integer status;

    // 车辆信息字段（通过关联查询获取）
    private String brand;           // 车辆品牌
    private String model;           // 车辆型号
    private String licensePlate;    // 车牌号
    private String color;           // 车辆颜色
    private String images;          // 车辆图片
    // 商家信息字段（通过关联查询获取）
    private String merchantName;      // 商家名称
    private String merchantContact;    // 商家负责人
    private String merchantPhone;      // 商家联系电话
    private String merchantAddress;   // 商家地址




    private String startTimeStr;
    private String endTimeStr ;
    private String actualStartTimeStr;
    private String actualEndTimeStr;


    public String getActualEndTimeStr() {
        return DateUtils.parseDate2Str(actualEndTime);
    }

    public String getActualStartTimeStr() {
        return DateUtils.parseDate2Str(actualStartTime);
    }

    public String getEndTimeStr() {
        return DateUtils.parseDate2Str(endTime);
    }

    public String getStartTimeStr() {
        return DateUtils.parseDate2Str(startTime);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getCarId() {
        return carId;
    }

    public void setCarId(String carId) {
        this.carId = carId;
    }

    public String getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(String merchantId) {
        this.merchantId = merchantId;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getActualStartTime() {
        return actualStartTime;
    }

    public void setActualStartTime(Date actualStartTime) {
        this.actualStartTime = actualStartTime;
    }

    public Date getActualEndTime() {
        return actualEndTime;
    }

    public void setActualEndTime(Date actualEndTime) {
        this.actualEndTime = actualEndTime;
    }

    public String getRentDays() {
        return rentDays;
    }

    public void setRentDays(String rentDays) {
        this.rentDays = rentDays;
    }

    public String getDailyRent() {
        return dailyRent;
    }

    public void setDailyRent(String dailyRent) {
        this.dailyRent = dailyRent;
    }

    public String getEstimatedTotalAmount() {
        return estimatedTotalAmount;
    }

    public void setEstimatedTotalAmount(String estimatedTotalAmount) {
        this.estimatedTotalAmount = estimatedTotalAmount;
    }

    public String getOvertimeFee() {
        return overtimeFee;
    }

    public void setOvertimeFee(String overtimeFee) {
        this.overtimeFee = overtimeFee;
    }

    public String getDamageFee() {
        return damageFee;
    }

    public void setDamageFee(String damageFee) {
        this.damageFee = damageFee;
    }

    public String getFinalAmount() {
        return finalAmount;
    }

    public void setFinalAmount(String finalAmount) {
        this.finalAmount = finalAmount;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

}
